# -*- coding: UTF-8 -*-


from .baseview import BaseView


class TreeBaseView(BaseView):
    def __init__(self, action_id, **kwargs):
        super().__init__(action_id, **kwargs)

    def search_read(self, domain=None, limit=None):
        Model = self.Model
        fields = self.fields_list
        domain = domain or []
        offset = 0
        # limit = 0
        order = ''
        context = self.context

        return Model.search_read(
            domain=domain, fields=fields,
            offset=offset, limit=limit, order=order, context=context)


class TreeView(TreeBaseView):
    def __init__(self, action_id, **kwargs):
        super().__init__(action_id, type='tree', **kwargs)
